package com.mls.fivedistrict.pojo;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * <p>
 * </p>
 *
 * @author Five Team
 * @since 2018-05-16
 */
@Data
@Accessors(chain = true)
@TableName(value = "t_goods_pay_integral", resultMap = "BaseResultMap")
public class GoodsPayIntegral extends Model<GoodsPayIntegral> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 积分ID
     */
    @NotNull(message = "积分Id不能为空")
    private Long integralId;
    /**
     * 商品ID
     */
    @NotNull(message = "商品id不能为空")
    private Long goodsId;
    private Date createDate;
    private Date updateDate;
    private String createBy;
    @TableLogic
    private Boolean isDelete;
    private Boolean isEnable;

    /**
     * 消费返利比例
     */
    private Double rebateRatio;

    private transient Integral integral;

    public Boolean getDelete() {
        return isDelete;
    }

    public void setDelete(Boolean delete) {
        isDelete = delete;
    }

    public Boolean getEnable() {
        return isEnable;
    }

    public void setEnable(Boolean enable) {
        isEnable = enable;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
